home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / CenteredScrollPane.as < prev    next >
Text File  |  2007-11-08  |  2KB  |  58 lines

  1. class CenteredScrollPane extends mx.containers.ScrollPane
  2. {
  3.    static var symbolName = "CenteredScrollPane";
  4.    static var symbolOwner = CenteredScrollPane;
  5.    var className = "CenteredScrollPane";
  6.    function CenteredScrollPane()
  7.    {
  8.       super();
  9.       this.dummyPreview._visible = false;
  10.    }
  11.    function size()
  12.    {
  13.       super.size();
  14.       var _loc3_ = undefined;
  15.       var _loc4_ = undefined;
  16.       var _loc6_ = this.__get__maxHPosition();
  17.       var _loc5_ = this.__get__maxVPosition();
  18.       if(this.spContentHolder._width > this.__width)
  19.       {
  20.          _loc3_ = this.hPosition / _loc6_;
  21.          this.__set__hScrollPolicy("on");
  22.          if(_loc6_ == 0)
  23.          {
  24.             _loc3_ = this.__get__maxHPosition() / 2 << 0;
  25.          }
  26.          else
  27.          {
  28.             _loc3_ = _loc3_ * this.__get__maxHPosition() << 0;
  29.          }
  30.       }
  31.       else
  32.       {
  33.          this.__set__hScrollPolicy("off");
  34.          _loc3_ = - (this.__width - this.spContentHolder._width) / 2 << 0;
  35.       }
  36.       if(this.spContentHolder._height > this.__height)
  37.       {
  38.          _loc4_ = this.vPosition / _loc5_;
  39.          this.__set__vScrollPolicy("on");
  40.          if(_loc5_ == 0)
  41.          {
  42.             _loc4_ = this.__get__maxVPosition() / 2 << 0;
  43.          }
  44.          else
  45.          {
  46.             _loc4_ = _loc4_ * this.__get__maxVPosition() << 0;
  47.          }
  48.       }
  49.       else
  50.       {
  51.          this.__set__vScrollPolicy("off");
  52.          _loc4_ = - (this.__height - this.spContentHolder._height) / 2 << 0;
  53.       }
  54.       this.setHPosition(_loc3_);
  55.       this.setVPosition(_loc4_);
  56.    }
  57. }
  58.